package phapp.dao.barapp;

import java.util.List;

import javacommon.base.*;
import cn.org.rapid_framework.page.*;
import org.springframework.stereotype.Component;

import phapp.model.barapp.*;

/**
  * <p> 标题: 会员交友日志表 ,tc_vip_log_friend_info 数据处理层
  * <p>Description : 执行./mapper/的VipLogFriendMapper.xml的相应SQL语句
  * <p>Copyright: Copyright (c) 2014-10
  * <p>Company:
  * @see phapp.model.barapp.VipLogFriend
  * @author you name
  * @version 1.0
*/

@Component
public class VipLogFriendDao extends BaseIbatis3Dao<VipLogFriend,java.lang.Integer>{

   public Class getEntityClass() {
      return VipLogFriend.class;
   }
   /**
   * <p> 标题:修改和新增<br>
   * <p>Description :
   * @param VipLogFriend u  
   */
   public void saveOrUpdate(VipLogFriend entity) {
      if(entity.getId() == null)
         save(entity);
      else
         update(entity);
   }

   /**
   * <p> 标题:批量删除<br>
   * <p>Description :
   * @param VipLogFriend u
   * @return int 
   */
   public int removeByIdArry(VipLogFriend u) {
      int i=-1;
      i =delete("VipLogFriend.removeByIdArry", u);
      return i;
   }
   /**
   * <p> 标题:分页查询<br>
   * <p>Description :
   * @param PageRequest pageRequest
   * @return Page 
   */
   public Page findByPageRequest(PageRequest pageRequest) {
      return pageQuery("VipLogFriend.pageSelect",pageRequest);
   }


   /**
   * <p> 标题:按Bean查询返回List<br> 
   * @param VipLogFriend bean
   * @return List 
   */
   public java.util.List findListByBean(VipLogFriend bean){
	   return  getSqlSessionTemplate().selectList("VipLogFriend.findListByBean",bean);
   }
   /**
    * <p>标题: 通讯录-新的朋友/验证消息-列表
    * <p>参数: String menberId  会员ID
    * <p>描述:  
    * @see phapp.model.barapp.VipLogFriend
    * @see phapp.model.barapp.vipMain  
    */
   public List  getNewFriendList(java.util.Map map)  {
		java.util.List<VipLogFriend> list =  getSqlSessionTemplate().selectList("VipLogFriend.getNewFriendList",map);
	    return list;
   }
   /**
    * <p>标题: 通过验证｜拒绝添加-新朋友请求
    * <p>参数: String mainId  主动者会员Id ,String recipientId 被加者会员Id,String circuit 状态或流程:1申请,2同意,3不同意,4删除好友,5黑名单,6其它
    * <p>描述:  
    * @see phapp.model.barapp.VipLogFriend 
    */
   public int verifyFriend (java.util.Map map ) {
	   int count = getSqlSessionTemplate().update("VipLogFriend.verifyFriend",map);
	   return count;
   }
   /**
	* <p>通过 Map 修改一条 数据<br> 
	* @param  java.util.Map 
   */
   public int updateByMap(java.util.Map map){
  		int count = getSqlSessionTemplate().update("VipLogFriend.update",map);
  		return count;
  }


}
